package com.aaa.os.controller;

import com.aaa.os.po.Order;
import com.aaa.os.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @fileName:OrderController
 * @description:
 * @author:忆尘
 * @createTime:2020/11/3 16:37
 * @version:1.0.0
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    /**
     * 删除
     * @param id
     * @return
     */
    @RequestMapping("deleteByPrimaryKey")
    public int deleteByPrimaryKey(Integer id){
        return orderService.deleteByPrimaryKey(id);
    }

    /**
     * 列表
     * @return
     */
    @RequestMapping("selectAll")
    public List<Order> selectAll(){
        return orderService.selectAll();
    }

    /**
     * 添加
     * @param record
     * @return
     */
    @RequestMapping("insertSelective")
    public int insertSelective(Order record){
        return orderService.insertSelective(record);
    }

    /**
     * 根据编号查询
     * @param id
     * @return
     */
    @RequestMapping("selectByPrimaryKey")
    public Order selectByPrimaryKey(Integer id){
        return orderService.selectByPrimaryKey(id);
    }

    /**
     * 更新
     * @param record
     * @return
     */
    @RequestMapping("updateByPrimaryKeySelective")
    public int updateByPrimaryKeySelective(Order record){
        return orderService.updateByPrimaryKeySelective(record);
    }

}
